home *** CD-ROM | disk | FTP | other *** search
/ Screensavers (Millenium Edition) / Screensavers (Millenium Edition).iso / Software / 3dfx / Holiday / holidaytheme.exe / holiday pack / scene.js < prev    next >
Encoding:
Text File  |  2000-05-15  |  1.7 KB  |  40 lines

  1. var DOWNLOAD_URL    = "http://www.wildtangent.com/download/"; // URL that opens when the web driver isn't installed.
  2.  
  3. // MSIE WebDriver Detection code for IE. Used to detect if the driver is installed:
  4. if ( document.all )
  5.     document.write( '<SCRIPT LANGUAGE="VBScript">\nfunction ieDetectDriver\non error resume next\nDim wtObject\nSet wtObject = CreateObject("WT3D.WT")\nif err.number <> 0 then\nSet wtObject = Nothing\nieDetectDriver = false\nelse\nSet wtObject = Nothing\nieDetectDriver = true\nend if\nend function\n<\/SCRIPT>' );
  6.  
  7. function WebDriverExists()
  8. {
  9.     return ( ( document.all && ieDetectDriver() ) || ( document.layers && ( navigator.plugins["WildTangent Web Driver Plugin"] && navigator.mimeTypes["application/x-wildtangent-web-driver"] && navigator.mimeTypes["application/x-wildtangent-web-driver"].enabledPlugin ) ) ) != null;
  10. }
  11.  
  12. // StartStage: Used when starting Java stages:
  13. function init()
  14. {
  15.     // Define the objects on the page:
  16.     var sceneBuilder = document.sceneBuilder,
  17.         WT             = document.scene;
  18.     
  19.     // Check to see if driver exists:
  20.     if ( !WebDriverExists()  ) 
  21.     {
  22.         if ( DOWNLOAD_URL != "" && confirm( "It appears that you do not have the latest WildTangent WebDriver installed on your machine.  Would you like to open a new window to download it?" ) )
  23.             open( DOWNLOAD_URL );
  24.         return;
  25.     }
  26.  
  27.     // check if our jar has been loaded
  28.     if ( !sceneBuilder.canRunJava() )
  29.     {
  30.         alert( "Java requires you to restart your system when new components are installed. You will need to do this before running this application for the first time." );
  31.         return;
  32.     }
  33.     
  34.     // Start the WT scene:
  35.     ( builder = sceneBuilder ).load( WT );
  36.     
  37.     window.onunload = new Function( "builder.unload();" );
  38. }
  39. onload = init;
  40.